package com.bsb.biz.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.bsb.base.mapper.BsbPolicyMapper;
import com.bsb.base.model.BsbPolicy;
import com.bsb.base.model.BsbPolicyExample;

@Service
public class BsbPolicyService{
	
	@Resource
	private BsbPolicyMapper bsbPolicyMapper;
	
	public void addBsbPolicy(BsbPolicy bsbPolicy) {
		bsbPolicyMapper.insertSelective(bsbPolicy);
	}
	
	public void delBsbPolicyByUuid(String uuid) {
		bsbPolicyMapper.deleteByPrimaryKey(uuid);
	}
	
	public void updateBsbPolicy(BsbPolicy bsbPolicy) {
		bsbPolicyMapper.updateByPrimaryKeySelective(bsbPolicy);
	}
	
	public void updateBsbPolicyByExample(BsbPolicy bsbPolicy,BsbPolicyExample bsbPolicyExample){
	    bsbPolicyMapper.updateByExampleSelective(bsbPolicy,bsbPolicyExample);
	}
	
	public BsbPolicy getBsbPolicyByUuid(String uuid) {
		return bsbPolicyMapper.selectByPrimaryKey(uuid);
	}
	
	public List<BsbPolicy> getPageBsbPolicy(BsbPolicyExample bsbPolicyExample) {
		return bsbPolicyMapper.selectPage(bsbPolicyExample);
	}
	
	public int countBsbPolicy(BsbPolicyExample bsbPolicyExample) {
		return bsbPolicyMapper.countByExample(bsbPolicyExample);
	}
	
	public List<BsbPolicy> selectByExample(BsbPolicyExample example){
	    return bsbPolicyMapper.selectByExample(example);
	}
}
